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 (4)

Answers (4)

Former Member
0 Kudos

Pl refer to Page 5 of the following article, change "parameters" to "parameter" in WSDL as explained in the article.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3057b5a7-99d0-2910-8f8f-f357dc4b...

Former Member
0 Kudos

Hi, could you share how you fixed the error? My team is facing the same error and we have been trying for three days already without any luck. Hope you can share your solution with us. Thanks.

rgrds, Pam.

Former Member
0 Kudos

This problem is solved.

Former Member
0 Kudos

This problem is solved.