How to create a WSDL web service

This forum is for general support of Xbase++
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to create a WSDL web service

#11 Post by rdonnay »

Using soapUI (opensource) is a tool to build calls
soap and also allows test
https://www.soapui.org/soap-and-wsdl/ge ... arted.html
Hector -

This sounds like good information.
I will look into this. Thank you.
The eXpress train is coming - and it has more cars.

patito
Posts: 121
Joined: Tue Aug 31, 2010 9:01 pm

Re: How to create a WSDL web service

#12 Post by patito »

Hi Roger

Url [""https://www.soapui.org/soap-and-wsdl/ge ... arted.html""]

SoapUI comes with extensive support for testing WSDL / SOAP based services;
• Easy import of WSDLs and default request generation allows for ad-hoc testing and exploring of services

Best Regard
Héctor

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to create a WSDL web service

#13 Post by rdonnay »

Once you achieve that works, it moves to xBase ++
No longer needed after the soapUI
This is all very confusing.

I went to the Soap UI website.
I looks as though the want me to pay for a license.
What is included in the license?

Is there a set of DLLs involved here?

Why do I need Pablo's library for this?

I watched a SoapUI Youtube video.
It looked like they were describing how to test an existing WSDL service, not create my own WSDL service.

Am I communicating that poorly on what it is I am trying to do?
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: How to create a WSDL web service

#14 Post by Cliff Wiernik »

Are you trying to send a request to someone else's soap service or have them connect to your soap server. A lot of the responses appear to be talking about sending the request instead of receiving it. What side are you need to setup.

In the project we are working on, we have to receive the request from their server, RouteOne and then after receiving the reply, validating the digital signature, we process the request and then send a response back to their SOAP server. So we have to have the soap server and soap client.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to create a WSDL web service

#15 Post by rdonnay »

A lot of the responses appear to be talking about sending the request instead of receiving it. What side are you need to setup.
Cliff -

I thought I was very clear when I said I need to "create" a web service based on WSDL. I need to have a server running which will receive a file whenever a client connects to it. The file will be an XML file.
The company who will be providing these files say they want us to set up a WSDL server so they can send us the files via WSDL/SOAP protocol. They want us to then give them the method to use.

I have used web services as a client. Bobby and I set up his system to do this years ago and we receive and send lots of data every day. I know how to do this. What I don't know how to do is to set up a Web Server based on WSDL and to create the methods.

I know how to create client/server systems using Xbase++ Web 2.0 systems based on HttpEndPoint and web sockets. You can look at all the samples I put in the \exp20\samples\web20 folder to see that I have some experience with this. I just don't know where to start with writing a web service in which I don't use Xb2Net.
The eXpress train is coming - and it has more cars.

patito
Posts: 121
Joined: Tue Aug 31, 2010 9:01 pm

Re: How to create a WSDL web service

#16 Post by patito »

Hi Roger

There are two versions of soapui, one is free and a paying

You only need the versión SoapUI OpenSource

url :: [https://www.soapui.org/downloads/soapui.html ]

Get the open source version of the most widely used API testing tool in the world.
Get It ------->> doble click and download

You once you get the method, the XML file request,
you can use, xb2net, soap, or library de Pablo is easier to use
I hope this clears your doubt

Best Regard
Héctor

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: How to create a WSDL web service

#17 Post by Cliff Wiernik »

Roger,

That is what I thought you meant. However, several of the other replies appeared to respond more to connecting as a soap client, not a soap server. Based on my prior discussions with Boris, he indicated its more of just formatting your response to match what they want to send you. In our current project, they have provided us with an XSD, which is a part of the WSDL. They did not provide a WSDL. What Jon did in our office is use SOAPUI and the XSD (which you can also generate from the XML) to fill in the blanks for the WSDL. It really just defines the SOAPACTIONS you will support. In looking at the webserve program in xb2net, the servicing of the SOAPActions is really just based on the soapaction in the Soap http message. But you have to just create a WSDL for them so they can plug it into your tool and connect to your server. The WSDL does not stop you from using XBase++. You just need to provide the template in the WSDL so the other party can read it and generate his classes and data structures to connect to the data you provide in the XML and with IP address/DNS, namespace definitions and soapactions you support.

Now the task I have in our project is to define using the xml file I received from the webservice Jon in our office is setting up. I will receive the XML in a replicated ADS table. Then I have to connect to their SOAP service with the format the provide as documented in a XSD and also via a excel file of additional explanations. I don't think I will have a problem with that. The biggest issue is generating the xml-dsig digital signing of the xml body portion of the soap package. The formatting is not hard to setup. The biggest issue is the canonicalization of the xml body. With the basic portion of the body, it is easy to do manually and then convert the manual process to code. However, if we eventually return changes to the application, the process is alot more difficult. That process is built into the dotnet libraries, java libraries or could be purchased in other forms including activeX support.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to create a WSDL web service

#18 Post by rdonnay »

In looking at the webserve program in xb2net, the servicing of the SOAPActions is really just based on the soapaction in the Soap http message. But you have to just create a WSDL for them so they can plug it into your tool and connect to your server. The WSDL does not stop you from using XBase++. You just need to provide the template in the WSDL so the other party can read it and generate his classes and data structures to connect to the data you provide in the XML and with IP address/DNS, namespace definitions and soapactions you support.
Yes, I know all of this. I just don't know how to do it simply and quickly. I already have a very simple solution for receiving a file. Any programmer who knows what a URL is would understand this:

https://<domain>:<port>/receivefile.cxp?file=AB002387190456....23090456

They simply need to convert the file to a hex string and send it in the url. I have tested this and it works perfectly. The XML files they want to send are small enough to be handled this way. They want to send the file via WSDL because they don't know how to send a URL. I hate complex solutions to simple problems.
The eXpress train is coming - and it has more cars.

patito
Posts: 121
Joined: Tue Aug 31, 2010 9:01 pm

Re: How to create a WSDL web service

#19 Post by patito »

Hi
Something simple is to use MSSOAPLib

Sample of using InterFAX binary files
' Warning: No error handling is provided in this sample...
'
Const WSDL = "http://ws.interfax.net/dfs.asmx?WSDL"
' To achieve a better performance, it is HIGHLY recommended to
' save the WSDL as a LOCAL file, thus eliminatig the need to
' download it before EACH access to InterFAX. In such case,
' replace the CONST statement with something like:
' Dim WSDL as string
' WSDL = App.Path & "\DfsWsdl.wsdl"
'
Private Sub cmdSend_Click()

Dim B() As Byte
Dim objSoap As New MSSOAPLib.SoapClient
Dim lngResult As Long
Dim strFileType As String
'
' Obtain file type
'
strFileType = Mid(txtFilename.Text, InStrRev(txtFilename.Text, ".") + 1)
'
' Read binary file data
'
Open txtFilename.Text For Binary Access Read Lock Read As #1
ReDim B(LOF(1) - 1) 'Keep enough space to read the entire file to memory
Get #1, , B
Close #1
'
' Initialize SOAP
'
objSoap.mssoapinit (WSDL)
'
' Submit the fax the data
'
lngResult = objSoap.SendFAX(txtUserName.Text, txtPassword.Text, txtFaxNumber.Text, B, strFileType)
'
' Display result
'
If lngResult > 0 Then
MsgBox "Fax submitted; TransactionID=" & lngResult
Else
MsgBox "Failed to submit fax; Error code=" & lngResult
End If
'
' Clean up
'
Set objSoap = Nothing

End Sub

'Note: If you are faxing from behind a proxy using MS SOAP v.3, you can use one of the two following options:

'Option 1 - Use automatic detection by:
objSoap.ConnectorProperty("EnableAutoProxy") = True

'Option 2 - Specify a proxy server:
objSoap.ConnectorProperty("ProxyServer") = "192.168.0.100"
'and optionally, if the proxy server is password-protected specify:
objSoap.ConnectorProperty("ProxyUser") = "Proxy Username"
objSoap.ConnectorProperty("ProxyPassword") = "Proxy Password"




--------------------------------------------------------------
"http://ws.interfax.net/dfs.asmx?WSDL"

METHOD SENDFAX

-<s:element name="Sendfax">


-<s:complexType>


-<s:sequence>

<s:element type="s:string" name="Username" maxOccurs="1" minOccurs="0"/>

<s:element type="s:string" name="Password" maxOccurs="1" minOccurs="0"/>

<s:element type="s:string" name="FaxNumber" maxOccurs="1" minOccurs="0"/>

<s:element type="s:base64Binary" name="FileData" maxOccurs="1" minOccurs="0"/>

<s:element type="s:string" name="FileType" maxOccurs="1" minOccurs="0"/>

</s:sequence>

</s:complexType>

</s:element>


Best Regard
Héctor

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: How to create a WSDL web service

#20 Post by skiman »

Hi Roger,

SOAPUI is as you already wrote to read WSDL files. You can't create them with it.

As I see it is a rather simple webservice? If you can send the INI file to test this service in your SOAPTEST sample, I can probably create the WSDL for you.
Best regards,

Chris.
www.aboservice.be

Post Reply