How to use XSD and WSDL in webservices transformer stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

How to use XSD and WSDL in webservices transformer stage

Post by srinivas143 »

Hi All,
We had requirement to send the data as an XML chunk as a webservice to message broker and we need to collect the response back to the file or database.

For that ppl working on Message broker are giving a separate XSD and WSDL structure to access through the webservices transformer stage.

Can anbody tell me how to import both WSDL and XSD through webservices transformer stage.

Appreciate your help!!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You import them via the Manager and then load that resulting metadata in the WS Transformer stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

Post by srinivas143 »

Hi,
I imported my XSD using datastage manager and I am trying to import my WSDL from Import->Table definitions->Web services WSDL definitions
In my WSDL the XSD path reference was mentioned but not the XSD was embeded in my WSDL.S, while importing Iam getting an error as follows

The XML Schema that defines the message structure has syntax or semantic errors. For more details, proceed to a manual mapping using the XML Meta Data Importer..

Could you please help me in this regard?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Assuming that the WSDL importer can at least parse the WSDL, bringing up a tree on the right hand side, open the Operation you want, select either the input or output message of the Operation, and right mouse.......select the XML meta data importer for that particular message part..........it means that the WSDL importer detected that the message part was too complex for the WSDL importer and requires the XML importer......

Second, you'll need to send your entire body to an xml stage after you receive it..... (see the pull down on the Message Tab for your output link).......

...there's a SOAPBody table definition that you can use, but basically it's just one big column.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

Post by srinivas143 »

Hi Ernie,
Thaks for your inputs.

I followed the same path as you mentioned below.

Assuming that the WSDL importer can at least parse the WSDL, bringing up a tree on the right hand side, open the Operation you want, select either the input or output message of the Operation, and right mouse.......select the XML meta data importer for that particular message part..........it means that the WSDL importer detected that the message part was too complex for the WSDL importer and requires the XML importer......


when importing through the XML metadat importer do I need to select the request and response fields as well for the message??

as the webservices document says it will automatically loads the name space for input and output messages..

couldyou please explain me how to proceed further??
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Not sure I entirely understand your question. If you choose to use the XML meta data importer on the right mouse option, you will be brought into it two times....once for the request, and then again for the response.

You will then need to be comfortable with the XML Meta Data Importer......

In the most complex case, you will have to build the xml SOAP body to send to WSTransformer, and then use XMLInput after WSTransformer to parse out the return body.

As a precaution, put a regular Transformer between your WSTran and your XML Stages.....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

Post by srinivas143 »

Thank you Ernie for your inputs!!

While importing through XML Metadata importer Do I need to create a separate XML table definitions for REQUEST and RESPONSE??

I tried creating the two separate XML table definitions but its not creating two definitions instead its overriding the existing one.

Could you please help me in this regard.

If there are any documentation for the same will be helpful in this regard.

Kind Regards
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

It ought to let you create two separate ones, or when you say save, send it to the name that you require..... ultimately yes, you'll need two. I guess worst case, if the GUI for you isn't allowing it, or if there's a naming convention conflict (or maybe I'm just not communicating it well ;) ), you could always create one, save it, then quit, go into DS Manager, rename it, and do it again and save the response.......

Working thru a web service like this can get tedious. It's going to require that you are comfortable with XMLInput, and XMLOutput and also with working with the WSTransformer. Using each has its own learning curve. I hate making blatant plugs for my blog, so apologies in advance, but I do have some basic examples on Web Services there (see link below) that you might find helpful.

I have yet to put up a "how to" for a full blown complex scenario as you are having here, but the "array" example that is already there on the site, along with the discussion of complex web services, will point you in the right direction.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

Post by srinivas143 »

Thank you Ernie...I will look into those possible options and scenarios


Kind Regards
Srinivas
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

Post by srinivas143 »

Hi Ernie

I tried creating two XML's for request and response which were stored in Table Definitions->XML->Imports

And when I am trying to import the XSD using XML metadat Importer Iam getting the following error messages while importing

Type'CustomerDetailsReq' is not declared
Type'CustomerDetails' is not declared
Type'CustomerDetailsRes' is not declared


And my WSDL was stored in the location Table Definitions->WebServices
as folllows

Customer_MsgCat_IN
Customer_MsgCat_MSGIN
Customer_MsgCat_MSGOUT
Customer_MsgCat_OP
Info_WS

I am missing the Customer_MsgCat_OUT in my WSDL definition.


And please find the sample WSDL and XSD which was provided for me by the message broker people to access their webservice.

XSD
-----

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="CustomerDetailsReq">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" ref="CustomerDetails"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="CustomerDetailsReq" type="CustomerDetailsReq">
</xsd:element>
<xsd:element name="FirstName" type="xsd:string"/>
<xsd:element name="LastName" type="xsd:string"/>
<xsd:element name="Email" type="xsd:string"/>
<xsd:element name="CustomerDetails" type="CustomerDetails"/>
<xsd:complexType name="CustomerDetails">
<xsd:sequence>
<xsd:element ref="FirstName"/>
<xsd:element ref="LastName"/>
<xsd:element ref="Email"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustomerDetailsRes">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" ref="CustomerDetailsOut"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="CustomerDetailsRes" type="CustomerDetailsRes">
</xsd:element>
<xsd:element name="CusId" type="xsd:string"/>
<xsd:element name="CustomerDetailsOut" type="CustomerDetailOut"/>
<xsd:complexType name="CustomerDetailOut">
<xsd:sequence>
<xsd:element ref="CusId"/>
<xsd:element ref="Email"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>


WSDL Definition:
-------------------

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) -->
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/Customer_MsgSet" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Customer_MsgSet" targetNamespace="http://tempuri.org/Customer_MsgSet">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:mrm="http://tempuri.org/Customer_MsgSet" targetNamespace="http://tempuri.org/Customer_MsgSet">
<include schemaLocation="Customer_MsgDef.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="Customer_MsgCat_in">
<wsdl:part name="CustomerDetailsReq" element="tns:CustomerDetailsReq"/>
</wsdl:message>
<wsdl:message name="Customer_MsgCat_out">
<wsdl:part name="CustomerDetailsRes" element="tns:CustomerDetailsRes"/>
</wsdl:message>
<wsdl:portType name="Customer_MsgSetPortType">
<wsdl:operation name="Customer_MsgCat">
<wsdl:input name="Customer_MsgCat_CustomerDetailsReq" message="tns:Customer_MsgCat_in"/>
<wsdl:output name="Customer_MsgCat_CustomerDetailsRes" message="tns:Customer_MsgCat_out"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Customer_MsgSetSOAP_HTTP_Binding" type="tns:Customer_MsgSetPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Customer_MsgCat">
<soap:operation soapAction="Customer"/>
<wsdl:input name="Customer_MsgCat_CustomerDetailsReq">
<soap:body parts=" CustomerDetailsReq" use="literal"/>
</wsdl:input>
<wsdl:output name="Customer_MsgCat_CustomerDetailsRes">
<soap:body parts=" CustomerDetailsRes" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Customer_MsgSetSOAP_HTTP_Service">
<wsdl:port name="SOAP_HTTP_Port" binding="tns:Customer_MsgSetSOAP_HTTP_Binding">
<soap:address location="http://10.162.197.87:9080/wassoap/servlet/router"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>



Could you please help me in this regard


Kind Regards
srinivas143
Participant
Posts: 30
Joined: Tue Feb 19, 2008 11:02 pm

Post by srinivas143 »

Hi All
When Iam using webservices transformer stage inorder to call the webservices provided by message broker ....I am getting the following error.


APT_CombinedOperatorController,0: Fatal Error: Fatal: ---- response exception ----
AxisFault
faultCode: {http://xml.apache.org/axis/}Call.invoke
faultSubcode:
faultString: Cannot invoke Call with null namespace URI for method null
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: AxisFault
faultCode: {http://xml.apache.org/axis/}Call.invoke
faultSubcode:
faultString: Cannot invoke Call with null namespace URI for method null
faultActor:
faultNode:
faultDetail:
Cannot invoke Call with null namespace URI for method null
at org.apache.axis.client.Call.invoke(Call.java:2498)
at org.apache.axis.client.Call.invoke(Call.java:1753)
at com.ascentialsoftware.wsclient.OperationCall.invoke(OperationCall.java:266)
at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1659)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1566)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1519)
at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:102)
at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
at com.ascentialsoftware.jds.StageFactory.runTransformer(StageFactory.java:361)
at com.ascentialsoftware.wsclient.OperationCall.handleRemoteException(OperationCall.java:379)
at com.ascentialsoftware.wsclient.OperationCall.invoke(OperationCall.java:274)
at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1659)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1566)
at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1519)
at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:102)
at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
at com.ascentialsoftware.jds.StageFactory.runTransformer(StageFactory.java:361)


Could you please help me in this regard!!

Kind Regards
Srinivas
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

I've seen this on many occasions when the "method" in the message is the name of an element in the payload.... not exactly sure why it would be saying "null" at the end of that message....

Still, it's likely that there's a namespace needed "deeper" into the XML payload that makes up the input request.

Can you ask the provider folks for a sample SOAP envelope? That will be useful....or try SOAPscope or other testing tool that will let you easily invoke the service and capture the xml payload that it generates......

...then you can visually "see" what you need to format, and build it accordingly.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chowdary
Participant
Posts: 38
Joined: Thu Jun 23, 2005 11:25 am

WSDL Import error

Post by chowdary »

Hi Srinivs,

I am getting the same error. How you got this error fixed? i am doing exactly same thing that you are doing... Please let me know how you got this error fixed.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Begin by starting your own new post and giving us your particulars - version, O/S and the exact error you are getting. Jumping on the end of a post from 2008 isn't the way to get your issue resolved.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply