on 08-22-2008 10:25 PM
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
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)
This problem is solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I followed the method to work around this problem as described in the following document:
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.