cancel
Showing results for 
Search instead for 
Did you mean: 

Error consuming Enterprise Services in .Net Client - (error reflecting ...)

Former Member
0 Kudos

Error consuming NetWeaver Enterprise Services in .Net Client

I get error calling NetWeaver Enterprise Services:

Method EmployeeNameByEmployeeQueryResponse_InService.EmployeeNameByEmployeeQueryResponse_In can not be reflected

This is what I did

1. Create a C# Windows Application in Visual Studio 2005 with name POC_Client_For_EnterpriseServices

2. Add Web Reference to WSDL from

http://myserver.mycompany.com:8000/sap/bc/srt/xip/sap/ECC_EMPLOYEENAMEBYEMPLOYEEQR?sap-client=800&ws...

and give it this name: ECC_EMPLOYEENAMEBYEMPLOYEEQR

3. Add a using statement:

using POC_Client_For_EnterpriseServices.ECC_EMPLOYEENAMEBYEMPLOYEEQR;

4. Add a button named btnECC_EMPLOYEENAMEBYEMPLOYEEQR

5. Add a TextBox named ErrorMessage and set it's multiline property to True and expand it's height for multiline.

6. Write code in button_click event

private void btnECC_EMPLOYEENAMEBYEMPLOYEEQR_Click(object sender, EventArgs e)

{

try

{

EmployeeNameByEmployeeQueryMessageEmployeeNameSelectionByEmployee EmployeeNameSelectionByEmployee

= new EmployeeNameByEmployeeQueryMessageEmployeeNameSelectionByEmployee();

EmployeeNameSelectionByEmployee.EmployeeID = new EmployeeID();

EmployeeNameSelectionByEmployee.EmployeeID.Value = "00001273"; // or any other EmployeeID

Log Log = new Log();

EmployeeNameByEmployeeQueryResponse_InService proxy = new EmployeeNameByEmployeeQueryResponse_InService();

proxy.Credentials = GetCredentials();

proxy.EmployeeNameByEmployeeQueryResponse_In(EmployeeNameSelectionByEmployee, out Log);

}

catch (Exception ex)

{

ErrorMessage.Text = ex.Message + " " + ex.InnerException;

}

}

7. This is the detailed error:

Method EmployeeNameByEmployeeQueryResponse_InService.EmployeeNameByEmployeeQueryResponse_In can not be reflected.

System.InvalidOperationException: There was an error reflecting 'EmployeeNameSelectionByEmployee'. --->

System.InvalidOperationException: The Form property may not be 'Unqualified' when an explicit Namespace property is present.

at System.Xml.Serialization.XmlReflectionImporter.CheckForm(XmlSchemaForm form, Boolean isQualified)

at System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType, Boolean rpc, Boolean openModel)

at System.Xml.Serialization.XmlReflectionImporter.ImportMemberMapping(XmlReflectionMember xmlReflectionMember, String ns, XmlReflectionMember[] xmlReflectionMembers, Boolean rpc, Boolean openModel)

at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[] xmlReflectionMembers, String ns, Boolean hasWrapperElement, Boolean rpc, Boolean openModel)

--- End of inner exception stack trace ---

at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(XmlReflectionMember[] xmlReflectionMembers, String ns, Boolean hasWrapperElement, Boolean rpc, Boolean openModel)

at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean openModel, XmlMappingAccess access)

at System.Web.Services.Protocols.SoapReflector.ImportMembersMapping(XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, Boolean serviceDefaultIsEncoded, Boolean rpc, SoapBindingUse use, SoapParameterStyle paramStyle, String elementName, String elementNamespace, Boolean nsIsDefault, XmlReflectionMember[] members, Boolean validate, Boolean openModel, String key, Boolean writeAccess)

at System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs)

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

This problem is solved.

Former Member
0 Kudos

the community style of things would be to drop a line or two on how you solved it. or what insight should someone later gain, searching SDN and finding this thread?

Former Member
0 Kudos

I followed the method to work around this problem as described in the following document:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0421f9a-4c9e-2910-1085-a45f8e81...

Former Member
0 Kudos

thank you very much for sharing.