cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while Importing wsdl( Generated in XI) in Visual Studio

Former Member
0 Kudos

Hello XPert's,

I am working on a scenario where I have to call SAP XI web service in client .Net application using Visual Studio5.

I have already generated my wsdl using SAP XI Web Service wizard. Here is the part of my wsdl...

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:p1="http://ccsd.net/sapr3/wm/manifest" name="MI_MULT_IMAGES" targetNamespace="http://ccsd.net/sapr3/wm/manifest">

<wsdl:documentation>

Message interface for outbound

</wsdl:documentation>

<wsdl:types>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://ccsd.net/sapr3/wm/manifest" targetNamespace="http://ccsd.net/sapr3/wm/manifest">

<xsd:element name="MT_RECORD_MULTIPLE" type="SAVEIMAGE_MULTIPLE" />

<xsd:complexType name="SAVEIMAGE_MULTIPLE">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

f3999640f96e11dcae470003bab2aa70

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="DT_IMAGES" maxOccurs="unbounded">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7b023f10f91011dca4280011439c56bd

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="ImageName" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7b023f11f91011dcb4b70011439c56bd

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="ImageData" type="xsd:base64Binary">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7b023f12f91011dc9ded0011439c56bd

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

</wsdl:types>

<wsdl:message name="MT_RECORD_MULTIPLE">

<wsdl:documentation>

Message type

</wsdl:documentation>

<wsdl:part name="MT_RECORD_MULTIPLE" element="p1:MT_RECORD_MULTIPLE" />

</wsdl:message>

<wsdl:portType name="MI_MULT_IMAGES">

<wsdl:operation name="MI_MULT_IMAGES">

<wsdl:output message="p1:MT_RECORD_MULTIPLE" />

</wsdl:operation>

</wsdl:portType>

<ifr:properties xmlns:ifr="urn:com-sap:ifr:v2:wsdl">

<ifr:category>

ifmmessif

</ifr:category>

<ifr:methods>

<ifr:method name="MI_MULT_IMAGES">

<ifr:isSynchron>

false

</ifr:isSynchron>

<ifr:isInbound>

false

</ifr:isInbound>

<ifr:interfaceCategory>

outbound

</ifr:interfaceCategory>

</ifr:method>

</ifr:methods>

<ifr:messages>

<ifr:message name="MT_RECORD_MULTIPLE">

<ifr:messType>

ifmmessage

</ifr:messType>

<ifr:technicalNamespace>

http://ccsd.net/sapr3/wm/manifest

</ifr:technicalNamespace>

</ifr:message>

</ifr:messages>

</ifr:properties>

</wsdl:definitions>

However,

Whenever I tried to import the wsdl in visual studio, it do not create / generate the classes for the element with maxoccurs="unbounded" ( here DT_IMAGES)...its just disappear...and makes diifficult for calling webservice-method in client application.

Anybody has faced this problem before? there is any workaround for this?

All help/suggestion would be highly appreciated.

Thanks & Rgds,

Nilesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nilesh,

Look into the WSDL.

Every Element has a type. Either it can be basic XSD type, i.e. string numeric etc. or it can also refer to some 'type' from other XML Schema.

But it you see this line.

<xsd:element name="DT_IMAGES" maxOccurs="unbounded">

There is no type associated with it. It means it has no existance and as it is defined as complex type, but there is no element which is contained in it.

Try to look into XI IR , How it is defined in IR.

Hope this helps.

Regards,

Piyush

Former Member
0 Kudos

Hi Piyush,

Thanks for your prompt reply. Hoever my expected output result is :

<MT....

<DT_IMAGE>

<ImageData>.......</ImageData>

<ImageName>.......</ImageName>

<DT_IMAGE>

<DT_IMAGE>

<ImageData>.......</ImageData>

<ImageName>.......</ImageName>

<DT_IMAGE>

...

...

...

..where as DT_IMAGE sits on the top of the ImageData / Imagename and has maxOccurs="unbounded". It is defined as a complex type.

Nilesh

Former Member
0 Kudos

Hi Nilesh,

Can you try modifying your WSDL a bit by defining DT_IMAGES as complex type directly in definition because your previous WSDL is causing ambiguity. It will not affect your message structure.Please see the BOLD Lines.

...........

..................

<xsd:element name="MT_RECORD_MULTIPLE" type="SAVEIMAGE_MULTIPLE" />

<xsd:complexType name="SAVEIMAGE_MULTIPLE">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

f3999640f96e11dcae470003bab2aa70

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:complexType name="DT_IMAGES" maxOccurs="unbounded">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7b023f10f91011dca4280011439c56bd

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="ImageName" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7b023f11f91011dcb4b70011439c56bd

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="ImageData" type="xsd:base64Binary">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

7b023f12f91011dc9ded0011439c56bd

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

</wsdl:types>

..........

...........

Regards,

Piyush

Former Member
0 Kudos

Hello Piyush,

Thanks for your response. I had tried that before but with below changes Visual Studio 2005 wont allow you to import wsdl..( error : wsdl format is not correct).

This is basic problem with Visual Studio 2005. It do not generate proper classes if you have complex elements/ types in your wsdl.

Anyway I have resolved issue by writing class code inside Reference.vb..and now its working as per Web service configuration.

Thanks a lot guys for suggestions / help.

Nilesh

Answers (0)