There are also tools available that will create client code from the WSDL file. Apache Axis is the next generation SOAP API and includes tools for this.
http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-axis/java/docs/user-guide.html#WSDL2Java:%20Building%20stubs,%20skeletons,%20and%20data
Barry
At 11:34 29/08/2003, you wrote:
Many thanks Barry,
I've not been given the WSDL yet although I've asked for it.
I have the book you mentioned and will wait until I get the WSDL before I go any further.
Best Wishes
Neil
-----Original Message----- From: Barry White [mailto:[EMAIL PROTECTED] Sent: 29 August 2003 11:05 To: [EMAIL PROTECTED] Subject: Re: New to SOAP, need help with code
Hi Neil,
unfortunately I've never used .NET and I'm pretty new to Java too. But I learnt it all from the Java Web Services book (plus some very useful help from this newsgroup).
It seems that knowing more about the web service would help you, rather than just trying to 'blindly' translate the code to Java (what are the parameter types and return type?). Have you studied the WSDL file which describes the service? http://xxxxx.co.uk/CardPaymentInterface.wsdl
My suggestion would be to do that and then forget about .NET for a bit. Use the book to implement the service client and see how you get on.
There may be some interoperability issues between Apache and .NET so look into that if you're still having problems. This is unlikely though if the service only uses simple data types (int, string, etc).
Good luck, Barry
At 08:15 29/08/2003, you wrote: >Hi, I have been given the following example (unfortunately in .NET) that I >need to use via SOAP. > >I have read 2 books Java Web SErvices / Java and XML and spent 11 days >trying to change it but do not even know where to start (I've only been >doing Java etc for 3 months and am learning it all from books) > >I have been told by the people who created the .net version below that the >interface made available is "CardPaymentRequestXML" > >Is there any way someone can help me get this into Apache SOAP please ? Is >there anything else I would need that's not here? > >Many thanks in advance > >Neil > >------------------------------------------------------------------------- >.NET EXAMPLE: > >'Create a reference to the SOAP client object >Dim objSoapClient as SoapClient >Set objSoapClient = New SoapClient > >' String to hold Response [out] >Dim strXMLResponse as string > >' String to hold the complete payment request [in] >Dim XMLCardPaymentRequest as String > >XMLCardPaymentRequest = "<Request xmlns='http://xxxxx.co.uk'><UserRef>I'm >stuck</UserRefe></Request>" > >' Initialise the soap client object with the WSDI, configuration files >Call objSoapClient.mssoapinit >("http://xxxxx.co.uk/CardPaymentInterface.wsdl", "", "", >"http://xxxxx.co.uk/CardPaymentInterface.wsml") > >' call the CardPaymentRequest method >strXMLResponse = objSoapClient.CardPaymentRequestXML(XML,CardPaymentRequest) > >' Parse the returned XML >Dim objXML as FreeThreadedDOMDocument40 >Dim objNode as IXMLDOMNode >Dim strStatus as string > >Set objXML = New FreeThreadedDOMDocument40 >objXML.async = False >objXML.loadXML strXMLResponse >Set objNode = objXML.selectSingleNode("//Status") >If (objNode Is Nothing) = False Then > If Len(objNode.Text) > 0 Then > strStatus = objNode.Text > End If >End If >If strStatus = "0" Then > ' Successful >Else > ' Failed >End If > >--------------------------------------------------------- >Scanning of this message and addition of this footer is performed by >SurfControl SuperScout Email Filter software in conjunction with >virus detection software. >---------------------------------------------------------
--------------------------------------------------------- Scanning of this message and addition of this footer is performed by SurfControl SuperScout Email Filter software in conjunction with virus detection software. ---------------------------------------------------------
--------------------------------------------------------- Scanning of this message and addition of this footer is performed by SurfControl SuperScout Email Filter software in conjunction with virus detection software. ---------------------------------------------------------