1
    string endpointURL = "xxxx";
    var remoteAddress = new ServiceReference.Endpoint(endpointURL);
    var bind = new System.ServiceModel.BasicHTTPSBinding();
    ServiceReference.ServiceReferenceClient client= new ServiceReference.ServiceReferenceClient(bind, remoteAddress);AddData request = new AddData();
    request.authentication = authentication;
    request.transaction_id = transaction_id;
    request.subjects = Subjects; 
    request.students = Students; 
    addDataResponse = await client.addData(request);
    
    In Refernce.cs I have below classes
    public class students
    {
    public string name{get;set;}
    public string class{get;set}
    public bool IsGraduate{get;set;}
    public int Marks{get;set} 
    }
    public class subjects
    {
    public string name{get;set;}
    public string description{get;set}
    public bool IsRequired{get;set;}
    public int Count{get;set} 
    public int Test{get;set} 
    }
    
##    
*I am consuming SOAP client as above where 
    Subjects is the Object that holds database values for different Subjects Properties
    Student is the Object that holds database values for different Student Properties. 
    When I debug the code, many fields from Claim and Policy are missing in SOAP REQUEST BODY.
    I notice that only String data is getting binded in SOAP BODY but bool, INT, decimal, enum data is not there in the REQUEST BODY.
* ##

Why I am missing the non - string parameters in my request body when I pass it over as addData.Request(request); I can see complete data in request body in debug mode.

Expected XML from Request Body

<?xml version="1.0" encoding="UTF-8"?>
<student>
 <name>Tom Hnaks</name>
 <class>High</class>
 <IsGraduate>No</IsGraduate>
 <Marks>100</Marks>
</student>
<subjects>
 <name>Botany</name>
 <description>High</description>
 <IsRequired>No</IsRequired>
 <Test>100</Test>
 <Count>100</Count>
</subjects>

XML I am getting from Request Body

<?xml version="1.0" encoding="UTF-8"?>
<student>
 <name>Tom Hnaks</name>
 <class>High</class>
</student>
<subjects>
 <name>Botany</name>
 <description>High</description>
</subjects>
Navy
  • 33
  • 5

2 Answers2

1

It has been a while since I attempted to create a client in any .NET language for a SOAP web service. However I believe the wsdl exe command was most helpful for creating local proxy classes to use in C# to use when trying to invoke a webservice.

https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/7h3ystb6(v=vs.100)?redirectedfrom=MSDN

Once you have the proxy classes, I think you may have to go through the arduous task of mapping all the elements in your local C# Claim/Policy objects to the Claim/Policy objects specified in the proxy classes (and possibly converting object types as well). I hope this helps, please provide the Guidewire product and version you are using if you need further help.

Edit: It appears like SvcUtil may be the preferred choice now. I am not sure of the particular differences in how they generate proxy classes from a WSDL, but SvcUtil appears to be newer.

https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/generating-a-wcf-client-from-service-metadata

  • In debug mode , I can see data in below, I can see data in claim & policy objects [request.policyDTO = policy;]; Post binding, I can see data in request.policyDTO addFnolResponse res = client.AddFnol(resquest); When I check the deserialized request body in fiddler, I see ONLY strings fields from policyDTO are present.Other data fields are missing. My issue is Why these fields are not part of data transfer – Navy Jun 07 '23 at 23:13
  • So when you are in debug mode in Guidewire Studio you can see all the DTO objects properly populated (no matter the data type)? However when the response comes back to your C# SOAP client, only the fields that are of a String type are present? That is very odd and I am sorry I don't have an explanation for that. Have you tried invoking the Guidewire SOAP web service with a tool like SOAP-UI and seeing if the response back from Guidewire contains the missing fields? – SteveDrippsCentricConsulting Jun 08 '23 at 16:25
  • 1
    I found solution. There were attributes in WSDL reference file that were setting other parameters as false & hence not getting binded. Thanks for help!! – Navy Jun 16 '23 at 15:48
1

Reference.cs

When I further checked this file for WSDL service, I saw there are some bool parameters with same filed name within the student and subjects class ; by default marked as false and had [xmlignoreattribute] attached to it. Therefore when my request body when passed over the SOAP Client was not passing them. I explicit made them True & then Re-assigned values for the entire request body. It worked.. Wasted kin d of week as there was no documentation given from vendor


    In Refernce.cs I have below classes
    public class students
    {
    public string name{get;set;}
    public string class{get;set}
    public bool IsGraduate{get;set;}
    public int Marks{get;set} 

[system.xml.serialization.xmlIgnoreAttribute()]
 public bool IsGraduateSpecified{
get
{
return this.IsGraduateSpecified
}
set
{
return this.IsGraduateSpecified = value;
}
}
[system.xml.serialization.xmlElementAttribute(order=3)]
 public bool IsGraduate{
get
{
return this.IsGraduate
}
set
{
return this.IsGraduate = value;
}
}    


string endpointURL = "xxxx";
var remoteAddress = new ServiceReference.Endpoint(endpointURL);
var bind = new System.ServiceModel.BasicHTTPSBinding();
ServiceReference.ServiceReferenceClient client= new ServiceReference.ServiceReferenceClient(bind, remoteAddress);AddData request = new AddData();
request.authentication = authentication;
request.transaction_id = transaction_id;
request.subjects = Subjects; 
request.students = new students(); 
request.students.IsGraduateSpecified = true;
request.students.IsGraduate = student.IsGraduate; 
addDataResponse = await client.addData(request);
Navy
  • 33
  • 5