Skip to content

Commit

Permalink
Merge pull request #16 from dmt-software/2.1
Browse files Browse the repository at this point in the history
#14: Added some debug documentation
  • Loading branch information
proggeler authored Jan 16, 2020
2 parents 4613048 + 3470b12 commit 81f258c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# The MIT License (MIT)

Copyright (c) 2018 DMT-software <bas@dmt-software.nl>
Copyright (c) 2020 DMT-software <bas@dmt-software.nl>

> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,34 @@ $response = $serializer->deserialize('<env:Envelope ... </env:Envelope>', Respon

// $response instanceof ResponseMessage
```

### Debugging

#### Failing to make a request
When creating a SOAP message you must provide a XmlRoot and XmlRootNamespace. If you forgot to provide them an exception
is thrown "*Missing XmlRootName or XmlRootNamespace for ?YourSOAPRequest?".

To fix this add the XmlRoot annotation to your configuration:
```php
<?php
namespace Any\NS;

use JMS\Serializer\Annotation as JMS;

/**
* @JMS\XmlRoot("YourSOAPRequest", namespace="http://ns-for-your-request")
*/
class YourSOAPRequest
{
...
}
```
or if you're using yaml configuration:

```yaml
Any\NS\YourSOAPRequest:
...
xml_root_name: YourSOAPRequest
xml_root_namespace: http://ns-for-your-request
...
```

0 comments on commit 81f258c

Please sign in to comment.