cancel
Showing results for 
Search instead for 
Did you mean: 

Defining own data types for a Web Service

former_member198060
Participant
0 Kudos

Dear experts,

I am working on a scenario where I need to call an external Web Service.

The WSDL for this Web Service was provided to me but is very complex and inlcudes xsd:any subelements which are not described in detail in the WSDL.

Therefore I would like to model the message myself instead of using the WSDL.

Now I already have a question, using the standard conventions for Data Types DT_Name and Message Types MT_Name I am not sure how to handle the root Element. As the WSDL defines a specific root element that is expected from the Web Service, do I need to call my Data Type and Message Type by this specific name which is not in line with the standard naming conventions? Or is there a way to ignore the root Element which would be the Data Type name and use my first child element as the root element for the message later?

Accepted Solutions (0)

Answers (4)

Answers (4)

jagdishwar_b
Active Participant
0 Kudos

>The WSDL for this Web Service was provided to me but is very complex and inlcudes xsd:any subelements which are not described in detail in the WSDL.

>Therefore I would like to model the message myself instead of using the WSDL.

generally, if you recreate DTs MTs for the webservice, it is like undermining the real purpose/strength of WSDL.

the types element of wsdl does this job for us.

if the webservice provider used xsd:any elements, then it is better to ask webservice provider to refine the xsd types in wsdl to make it specific.

regards,

BJagdishwar.

Former Member
0 Kudos

Hi Peter,

If you are trying to call an external web service, then unfortunately you will have to follow the WSDL definition as supplied.  I suppose you could create your own custom version and then wrap that around the external service, however then you are creating redundancy and extra maintanence if anything changes.

Whilst having an xsd full of xsd:any elements isn't ideal, the definition is purely up to the publisher of that service.  Are you able to contact the provider of the servie and ask for documentation to support you in calling it?

Thanks,

Gareth.

udo_martens
Active Contributor
0 Kudos

Hi,

Therefore I would like to model the message myself instead of using the WSDL.

- This would not work, the service is expecting the structure (xsd) defined in the wsdl.

- The name of your message type will be finally the root tag name.

- Naming Conventions are just recommandations, you can follow them optional. Prefixes like "MT" or "DT" are from my point of view redundant, because you know always during design time which kind of object your are working with.

Regards,

Udo

zameerf
Contributor
0 Kudos

Hi Peter,

>>The WSDL for this Web Service was provided to me but is very complex and inlcudes xsd:any subelements which are not described in detail in the WSDL

Did you try this option if you are in PI 7.1?

http://wiki.sdn.sap.com/wiki/display/XI/PI+7.1+Import+Multiple+External+Data+Types+in+a+single+shot

former_member198060
Participant
0 Kudos

Hello Zameer,

Thank you for your reply. The main reason I want to use my own DT is to be flexible for future adjustments of the webservice call using external definitions in this case I think is complicating things.

My problem is mainly the root element of my DT which is the DT name by default. Is there a setting to overwrite this and use a specified value instead of the DT name at runtime? So that I could stick to our naming conventions and provide the expected root element in the web service call.

zameerf
Contributor
0 Kudos

>> The main reason I want to use my own DT is to be flexible for future adjustments of the webservice call

You have to always use the wsdl provided by the service provider to make a successful call. For any future adjustments in structure, your provider has to provide you the updated wsdl which you have to re import. Try to import wsdl and let us know if you face any issues.