How to create a WSDL web service

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

How to create a WSDL web service

#1 Post by rdonnay »

I have used SOAP extensively with Xb2net for years, but now I have a project in which the supplier of the data (XML) requires that we have a WSDL web service with methods that they can use to send us the file.

I had written a simple server to received XML files but the customer insists that they only know how to use WSDL services therefore my Xbase++ server cannot be used.

This has always been a frustration for me as I am not a C# programmer and my customer does not want to pay me to learn C#.

I think I understand that a WSDL service can be set up to run under IIS but I don't know how to start on this project. Does anyone have experience with this?
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: How to create a WSDL web service

#2 Post by bwolfsohn »

Roger,

I believe it's just a different format... So you need to parse the incoming and build the outgoing differently.. it looks like a form of xml...


http://www.w3schools.com/xml/xml_wsdl.asp

you s/b able to have an xb2net server receive and deliver wsdl
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

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

#3 Post by Cliff Wiernik »

Roger, I don't think it precludes the use of the xbase++ server. The WSDL is just the definition of the XSD for the xml and then the SOAP service that is being presented. They are likely using a tool/programming library that expects a WSDL (Web Service Definition Language) and generates all the wrappers/definitions/sql data linkages so they don't have to program that. Jon in our office developed our linkage to our web site and provided links to our other service. He does not use Xbase++ for these things. He uses java and spring.

We are doing connections to RouteOne to get in marine/RV dealer applications. He is setting up our incoming connection with his tools and providing me the xml file we receive in the SOAP envelope. I am providing the outgoing SOAP contact back to their service. For the incoming, they only provided an XSD definition, but no WSDL. His java/spring tools require a WSDL so he just created it based on the XSD and the contact points that they provided so his tools could create the connection interface.

In my use of xb2net and SOAP in the webserver for providing customer and dealer information to our automated phone system, the only real thing is the SOAPAction coming from the client. I did not provide a WSDL to develop the phone server (client) side of the connection. Jon created the WSDL. There are tools to build that, which includes the XSD, but you should still be able to use the XBase++ server. Unfortunately, you have to create the XSD from the XML using some tool and then the WSDL based on that, specifying the rest of your connection.

I wish Boris or Alaska had provided more of the pieces. If they want to get the foxpro people, they need to be stronger in this area to counteract the closer dotnet connections that foxpro has, especially with the wwdotnetbridge, which allows connection directly to dotnet without going the COM approach or building COM wrappers in dotnet to the dotnet assembly. That provides some of the tools that are available in dotnet for some of the web things like xml-dsig.

I am experiencing that now as the SOAP bodies I have to send back require xml-dsig signing. That requires canonical versions of the xml and a PKI library. CryptosysPKI, the companion to CryptosysAPI which I use for AES purposes meets that need but does not do the canonical xml transformation.

If you can build them a WSDL, which just defines how to connect to your Xbase++ server, what the SOAP actions are and the structure of your XML, you should be able to meet their needs. They cannot just look at the SOAP structure, the XML structure, the IP address/DNS name and make the connection. Their tool does that all based on the info in the WSDL, which as Boris would say is just another XML file with this information. It is no more than what the IDE form designers to for programmers.

Cliff.

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

Re: How to create a WSDL web service

#4 Post by patito »

Hi Roger

https://www.soapui.org/soap-and-wsdl/wo ... wsdls.html

Attach example Invoice Electronic use wsdl
with ot4xb.dll of Pablo Botella

best regard
Héctor Pezoa
Attachments
service.asmxWSDL.rar
(11.04 KiB) Downloaded 952 times

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

Re: How to create a WSDL web service

#5 Post by patito »

Hi Roger

Is very easy
-------call function --------
-------------------------------------------------------------------------------------------------
cXml := gen_loginCms( cText ) // Send
cResponse := XMLREQUEST("https://wsaahomo.afip.gov.ar/ws/services/LoginCms?wsdl');","None",cXml) //Receive
----------------------------------------------------------------------------------------------------

static function gen_loginCms( cText ) // method Wsdl
local cc := ;
'<?xml version="1.0" encoding="UTF-8"?>'+;
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +;
'<soap:Body>'+;
'<loginCms xmlns="http://wsaa.view.sua.dvadac.desein.afip.gov">'+;
'<in0>'+cText+'</in0>'+;
'</loginCms>'+;
'</soap:Body>'+;
'</soap:Envelope>'
return cc


FUNCTION XMLREQUEST(cUrl,cAction,cXml)
Local cResponse
local oHttp := TServerXMLHTTPRequest():New()

oHttp:Open( "POST" ,cUrl , .F.)
oHttp:SetReQuestHeader( "SOAPAction" , cAction )
oHttp:SetReQuestHeader( "Accept-Encoding" , "" )
oHttp:SetReQuestHeader( "Content-Type" , "text/xml;charset=UTF-8" )
oHttp:SetReQuestHeader( "User-Agent" , "pablito" )
oHttp:Send( cXml )
cResponse := oHttp:responseText

IF oHttp:status <> 200
? oHttp:status
cResponse := ""
endif
oHttp:release()

return cResponse

Best Regard
Héctor

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

Re: How to create a WSDL web service

#6 Post by rdonnay »

Thank you all for your responses.
This will probably help a lot.
The eXpress train is coming - and it has more cars.

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

Re: How to create a WSDL web service

#7 Post by rdonnay »

I wish Boris or Alaska had provided more of the pieces.
I agree.

The reason I wrote eXpress++ was to make it easy to get started with GUI but then to also make it robust.
The "getting started" part is always the most difficult for developers who don't have a lot of time for this stuff.

Reading a lengthy WSDL spec and then trying to figure out if I need another 3rd party library is cumbersome especially for such a small requirement of sending a file.

It always happens, on this forum, that when I request a solution to a problem another third party library is involved. My customer does not want to use any third party libraries that do not include source code, unless it is an ActiveX solution from a large developer. I can find no ActiveX solution and he doesn't want to pay me for spending a lot of time on this.

It would be nice if I could get a good start on writing this where I could simply use HttpEndpoint and Xbase++ code.

Maybe I will ask Alaska if they have a solution.
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: How to create a WSDL web service

#8 Post by c-tec »

Hello Roger,
I use Chilkat, costs about 280 $ for all ActiveX componentes, and is very powerful, I use it for very complicated things with Linux servers, SSH, SFTP, calling remote PHP programs on servers, XML parsing, encryption and a lot more. Maybe you find there something you can use.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

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

Re: How to create a WSDL web service

#9 Post by rdonnay »

I use Chilkat too for SFTP.

I will look into that.
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

#10 Post by patito »

hi Roger

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

Once you achieve that works, it moves to xBase ++
No longer needed after the soapUI

Enter your * .wsdl file in project
Analyze method to use this in the wsdl file
Copy Request1 (it's a xml) and then paste as a Function
and then calls with the

FUNCTION XMLRequest (Curl, CAction, cXML)
Local cResponse
Use TserverXmlRequest.prg (It is free to use and was built Pablo Botella)
The other solution is to use the curl library

Best Regard
Héctor

Post Reply