Search code examples
c#soaptypesfaultexception

Soap Fault Exception "The predefined Type does not exist"


I'm currently working on a task and I need to connect to a soap service and call a methode. But I always get the error:

"The predefined type does not exist. Please choose a type manually"

This is how the soap xml part looks like:

<soapenv:Body>
  <v2:create>
     <!--Optional:-->
   <v2:data>
    <creator>CREATOR</creator>
    <topicName>TOPICNAME</topicName>
    <typeName>TYPENAME</typeName>
    <variable>
        <technicalName>ArticleNumber</technicalName>
        <value>testpltd1</value>
    </variable>
    <variable>
        <technicalName>cdb_bezeichnung_</technicalName>
        <value>testtd1</value>
    </variable>  
    <variable>
        <technicalName>JobName</technicalName>
        <value>testtd1</value>
    </variable>
    <workflowTypeName>WORKFLOW</workflowTypeName>
     </v2:data>
  </v2:create>

Here is my code:

DsePortTypeV2Client s = new DsePortTypeV2Client();

s.ClientCredentials.UserName.UserName = USERNAME;
s.ClientCredentials.UserName.Password = PASSWORD;

SetCertificatePolicy();

descriptionDto desc = new descriptionDto();
desc.creator = CREATOR;
desc.topicName = TOPICNAME;
desc.typeName = TYPENAME;
desc.workflowTypeName = WORKFLOW;

variableDto ArticleNumber = new variableDto();
variableDto cdb_bezeichnung_ = new variableDto();
variableDto JobName = new variableDto();

ArticleNumber.technicalName = "ArticleNumber";
ArticleNumber.value = r.id;

cdb_bezeichnung_.technicalName = "cdb_bezeichnung_";
cdb_bezeichnung_.value = r.bezeichnung;

JobName.technicalName = "JobName";
JobName.value = r.bezeichnung;

desc.variable = new variableDto[] { ArticleNumber, cdb_bezeichnung_ , JobName }; 
result res = s.createV2(desc);

Or is it possible that I catch the command that is sent to the server before it is encrypted by ssl?


Solution

  • I simply called the wrong methode, the remote methode was s.create not createV2 so off course my description was missing.