cancel
Showing results for 
Search instead for 
Did you mean: 

Problem consuming a MII BLS as a Web service. No data getting displayed

Former Member
0 Kudos

Hi experts,

I am trying to consuming a MII BLS as a Web service from Visual Basic .Net 2010. But its a failure. I am unable to view any data on the VB grid. I did piece of code referring to the article in

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0563b23-be97-2b10-02a0-fb8fac9ab39e

I am totally new developer in Microsoft products. Here is the code that I used from the above white paper.

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim wsVcValues As New SapVcValues.XacuteWS

Dim myInParams As New SapVcValues.InputParams

Dim varResult As SapVcValues.Rowset

'Pass your input parameters to the transaction

myInParams.Plant = "1000"

'Now lets call the transaction using the guest account

varResult = wsVcValues.Xacute("guest", "guest", myInParams)

DataGridView1.DataSource = varResult.Row

DataGridView1.Refresh()

varResult = Nothing

End Sub

End Class

Here are some deviations when compared to the above article.

1. Used MII 12.1 transction.

2. Used VB .Net 2010 as the development environment.

The transaction that I used has 1 action with simple query which returns the o/p xml.

Please help! I am stuck.

Regards,

Rajesh.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have the same problem, I have a transaction witch gets me all the released production orders for a specified plant. The outputparameter is xml.

I also assigned a reference document:

[Assigning Reference Document|http://dl.dropbox.com/u/344185/Reference%20Document.png]

(Clicked on Assign Reference Document button after I took the screenshot)

Is this correct?

I then use visual studio 2010 and add a web reference. It works untill the point of returning a correct type as described in the white paper.

[Webservice in VS 2010 Output param|http://dl.dropbox.com/u/344185/VS2010MII.png]

Input parameters are provided ok.

Please let me know if you need anything else.

Kind Regards,

Lennart

gary_hall2
Member
0 Kudos

Just as an FYI: MII supports data types that are not part of the SOAP standard and are not understood outside of MII. In your case, rajgudipati, you're trying to return an XML data type and Microsoft's .Net framework doesn't have a matching data type, so it won't receive your response. I'm surprised you were able to execute the .Net code without an error. If you plan to expose your web service, you need to stick with the basic data types.

Former Member
0 Kudos

The webservice I tried use is in this format

http://<12.1 Server IP>:<port>/XMII/WSDLGen/MIIDemoHome/TestDemoTRX

Regards,

Rajesh

jcgood25
Active Contributor
0 Kudos

Have you looked at the WSDLGenSecurityEnabled setting on the System Administration menu page? Are you are getting the html source of the NetWeaver login page when requesting the WSDL (unchecking this setting will prevent this)?

Former Member
0 Kudos

Hi Jeremy,

You are right. I am getting a log in page when try to call the WS from the browser. I unchecked WSDLGenSecurityEnabled option. Now I am not redirected to log in page. But I am not getting the required output in the XML.

I am using SAP MII 12.1Service Pack 6.

Please find the XML the is getting displayed when I call the WS from browser below:

=====================================================================================================

<?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.sap.com/xMII" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.sap.com/xMII">

<!-- Types -->

<types>

<s:schema elementFormDefault="qualified" targetNamespace="http://www.sap.com/xMII">

<s:complexType name="InputParams">

<s:sequence id="InputSequence">

<s:element maxOccurs="1" minOccurs="0" name="Input1" type="s:string"/><s:element maxOccurs="1" minOccurs="0" name="Input2" type="s:string"/></s:sequence>

</s:complexType>

<s:element name="XacuteRequest">

<s:complexType>

<s:sequence>

<s:element maxOccurs="1" minOccurs="0" name="LoginName" type="s:string"/>

<s:element maxOccurs="1" minOccurs="0" name="LoginPassword" type="s:string"/>

<s:element maxOccurs="1" minOccurs="0" name="InputParams" type="s0:InputParams"/>

</s:sequence>

</s:complexType>

</s:element>

<s:complexType name="Rowset">

<s:sequence>

<s:element maxOccurs="unbounded" minOccurs="0" name="Row" type="s0:Row"/>

</s:sequence>

<s:attribute name="Message" type="s:string"/>

</s:complexType>

<s:complexType name="Row">

<s:sequence id="RowSequence">

<s:any maxOccurs="132" minOccurs="1" type="s:string"/></s:sequence>

</s:complexType>

<s:element name="XacuteResponse">

<s:complexType>

<s:sequence>

<s:element maxOccurs="1" minOccurs="0" name="Rowset" type="s0:Rowset"/>

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

</types>

<!-- Messages -->

<message name="XacuteSoapIn">

<part element="s0:XacuteRequest" name="parameters"/>

</message>

<message name="XacuteSoapOut">

<part element="s0:XacuteResponse" name="parameters"/>

</message>

<!-- Ports -->

<portType name="XacuteWSSoap">

<operation name="Xacute">

<input message="s0:XacuteSoapIn"/>

<output message="s0:XacuteSoapOut"/>

</operation>

</portType>

<!-- Bindings -->

<binding name="XacuteWSSoap" type="s0:XacuteWSSoap">

<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name="Xacute">

<soap:operation soapAction="http://www.sap.com/xMII" style="document"/>

<input>

<soap:body use="literal"/>

</input>

<output>

<soap:body use="literal"/>

</output>

</operation>

</binding>

<!-- Service mapping -->

<service name="XacuteWS">

<port binding="s0:XacuteWSSoap" name="XacuteWSSoap">

<soap:address location="http://192.168.128.41:50700/XMII/SOAPRunner/MIIDemoHome/DashBoard/Test121TRX"/>

</port>

</service>

</definitions>

jcgood25
Active Contributor
0 Kudos

Have you assigned a reference document to the xml output transaction property?

Former Member
0 Kudos

Hi Jeremy,

Yes I assigned an XML document structure to the the output XML variable. But it did not work. Below is the xml I assigned.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<Rowsets DateCreated="2011-02-25T00:22:51" EndDate="2011-02-25T00:21:57" StartDate="2011-02-25T00:21:57" Version="12.1.0 Build(201)">

<Rowset>

<Columns>

<Column Description="" MaxRange="1" MinRange="0" Name="OutputType" SQLDataType="1" SourceColumn="OutputType"/>

<Column Description="" MaxRange="1" MinRange="0" Name="OutputMessage" SQLDataType="1" SourceColumn="OutputMessage"/>

</Columns>

</Rowset>

</Rowsets>

When this did not work I tried to assign an XSD for this XML Please find y XSD below.

<?xml version="1.0" encoding="utf-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="Rowsets">

<xs:complexType>

<xs:sequence>

<xs:element name="Rowset">

<xs:complexType>

<xs:sequence>

<xs:element name="Columns">

<xs:complexType>

<xs:sequence>

<xs:element maxOccurs="unbounded" name="Column">

<xs:complexType>

<xs:attribute name="Description" type="xs:string" use="required" />

<xs:attribute name="MaxRange" type="xs:unsignedByte" use="required" />

<xs:attribute name="MinRange" type="xs:unsignedByte" use="required" />

<xs:attribute name="Name" type="xs:string" use="required" />

<xs:attribute name="SQLDataType" type="xs:unsignedByte" use="required" />

<xs:attribute name="SourceColumn" type="xs:string" use="required" />

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="Row">

<xs:complexType>

<xs:sequence>

<xs:element name="OutputType" />

<xs:element name="OutputMessage" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:sequence>

<xs:attribute name="DateCreated" type="xs:dateTime" use="required" />

<xs:attribute name="EndDate" type="xs:dateTime" use="required" />

<xs:attribute name="StartDate" type="xs:dateTime" use="required" />

<xs:attribute name="Version" type="xs:string" use="required" />

</xs:complexType>

</xs:element>

</xs:schema>

This approach also did not work out for me.

Regards,

Rajesh.

jcgood25
Active Contributor
0 Kudos

Assigning a reference document to the output xml property is not the same as putting a default value in the property field.

(http://help.sap.com/saphelp_mii121/helpdata/en/44/847b251e4355cee10000000a1553f6/frameset.htm).

Have you done this? You need to select the transaction property and assign a reference to another object (like a pointer to the xml structure that the output will deliver), using the dialog in the WB.